package com.coolingme.battercake.decorator;

/**
 * 煎饼装饰器模式测试
 *
 * @author wangyue
 * @date 2020-09-15 23:40
 */
public class Test {

    public static void main(String[] args) {
        // 一个基础煎饼
        Battercake battercake = new BaseBattercake();

        // 加了一个鸡蛋
        battercake = new EggDecorator(battercake);

        // 又加了一个鸡蛋
        battercake = new EggDecorator(battercake);

        // 加了一个香肠
        battercake = new SuasageDecorator(battercake);

        System.out.println(battercake.getMsg() + "  共" + battercake.getPrice() + "元");

    }

}
